package main

import "fmt"

var name = "axiang"

func main() {
	/*//字符串以双引号包裹
		c1 := "Hello 啊祥"
		//字符以单引号包裹
		c2 := 'a'
		fmt.Printf("%T\n", c1)
		fmt.Printf("%T\n", c2)
		//字符串转义符
		Path := "D:\\document\\learn\\1211"
		fmt.Println(Path)
		//多行字符串
		c3 := `
	    	先帝创业未半而中道崩殂
		今天下三分
		益州疲疲
		此诚危急存亡之秋也
	`
		fmt.Println(c3)
		//字符串拼接
		c4 := "阿宇"
		c5 := "Football"
		fmt.Printf("%s%s", c4, c5)        //Printf是拼接后输出
		c6 := fmt.Sprintf("%s%s", c4, c5) //Sprintf是拼接后赋值给变量
		fmt.Println(c4 + c5)
		fmt.Println(c6)
		//分割
		ret := strings.Split(Path, "\\")
		fmt.Println(ret)
		//包含
		c7 := strings.Contains(c5, "c")
		fmt.Println(c7)
		//前缀
		c8 := strings.HasPrefix(c5, "Fo")
		//后缀
		c9 := strings.HasSuffix(c6, "l")
		fmt.Printf("%v,%v", c8, c9)
		//子字符串出现为位置
		c10 := strings.Index(c5, "ba")
		c11 := strings.LastIndex(c5, "ba")
		fmt.Println(c10, c11)
		//拼接
		fmt.Println(strings.Join([]string{c3,c2},""))
		//字符
		a := '中'
		b := 'x'
		fmt.Printf("%T", a)
		fmt.Printf("%T", b)
	*/
	//fmt.Printf("%s\n",[]rune("Go语言"))
	//fmt.Printf("%q\n","GO语言")
	//fmt.Printf("%s\n",[]byte("GO语言"))
	//fmt.Printf("%c\n",'G')
	//fmt.Printf("%v","GO语言")
	var Dsf = "丁师傅的二弟叫做dickman"
	ddg := []byte(Dsf)
	Ddg := []rune(Dsf)
	ddg[8] = 'D'
	Ddg[8] = 'D'
	fmt.Printf("%s\n", string(ddg))
	fmt.Printf("%T\n", ddg)
	fmt.Printf("%s\n", string(Ddg))
	fmt.Printf("%T", Ddg)
}
